home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #6 / Amiga Plus CD - 2004 - No. 06.iso / AmigaPlus / Begleitmaterial / 50Tools / Grafik / PerfectPaint / rexx / box / Button.rx < prev    next >
Text File  |  2002-10-28  |  2KB  |  106 lines

  1. /*
  2. Button.rx by Saint
  3. (box Script)
  4. V1.0
  5. */
  6.  
  7.     options results
  8.     parse ARG Port x1 y1 x2 y2 b
  9.  
  10.     ADDRESS COMMAND
  11.     Press=0
  12.     Size=4
  13.     IF EXISTS('PerfectPaint:Prefs/Rexx_Prefs/button') THEN DO
  14.         IF OPEN('lfile','PerfectPaint:Prefs/Rexx_Prefs/button', "R") then DO
  15.             Size= READLN('lfile')
  16.             Press= READLN('lfile')
  17.             CALL CLOSE('lfile')
  18.         END
  19.     END
  20.  
  21.  
  22.     ADDRESS Value Port
  23.  
  24.     pp_DialogInit 140 75 "*Button*" 2
  25.         pp_Integer 0 80 5 35 20 "Bevel*Size" 1 Size
  26.         pp_Checkbox 1 80 27 50 16 "Pressed" 0 Press
  27.     pp_Dialog
  28.     rc=result
  29.     IF rc=0 then DO
  30.         EXIT
  31.     END
  32.  
  33.     pp_GetDialog 0
  34.     Size=result
  35.  
  36.     pp_GetDialog 1
  37.     Press=result
  38.  
  39.         pp_Updateundobox x1 y1 x2 y2
  40.         pp_clearrange 0
  41.         pp_EffectOn
  42.         pp_ComposeReqOff
  43.  
  44.         if Press=1 then DO
  45.         a=3
  46.         b=1
  47.     END
  48.     ELSE DO
  49.         a=1
  50.         b=3
  51.     END
  52.  
  53.     PP_Gradient 0 1  /*Vertical*/
  54.     pp_SetRange 0 0 64 64 64 
  55.     pp_setRange 0 19 0 0 0
  56.     pp_compose a 100 /*Add*/
  57.     pp_ComposeReq off
  58.     pp_boxF x1 y1 x2 y1+size /*Oben*/
  59.     PP_Gradient 0 0 /*Horizontal*/
  60.     pp_BoxF x1 y1 x1+size y2 /*Links*/
  61.     PP_Gradient 0 1
  62.     pp_SetRange 0 0 0 0 0
  63.     pp_setRange 0 19 64 64 64 /*Invert Range*/
  64.     pp_Compose b 100 /*Sub*/
  65.     pp_BoxF x1 y2 x2 y2-size /*Unten*/
  66.     PP_Gradient 0 0 /*Horizontal*/
  67.     pp_BoxF x2 y1 x2-size y2 /*Rechts*/
  68.     
  69.     /*Restore old*/
  70.     pp_ClearRange 0
  71.     pp_EffectOff
  72.     pp_ComposeReqOn
  73.     pp_Compose 0 100
  74.  
  75.     saveprefs("button",size,press)
  76. exit
  77.  
  78. SavePrefs: PROCEDURE
  79.     
  80.     Prefname='PerfectPaint:Prefs/Rexx_Prefs/'||ARG(1)
  81.     say prefname
  82.  
  83.     if EXISTS(Prefname) THEN DO
  84.         ADDRESS COMMAND
  85.         'delete >nil: '||Prefname
  86.     END
  87.  
  88.     IF OPEN('pfile',PrefName,'W') THEN DO
  89.  
  90.     do i=2 to ARG()
  91.         CALL WRITELN('pfile',ARG(i))
  92.     end
  93.  
  94.     CALL CLOSE('pfile')
  95.  
  96. RETURN
  97. ==
  98.  
  99.  
  100. -- 
  101. Markus Castro <Markus@Amigafuture.de>                               (Y)
  102.  ________       ____     _      __                                 (°-°)
  103. /_  __/ /  ___ / __/__ _(_)__  / /_   Amiga Aktuell Autor         ()-,-()--<{@
  104.  / / / _ \/ -_)\ \/ _ `/ / _ \/ __/                               (_)-(_)
  105. /_/ /_//_/\__/___/\_,_/_/_//_/\__/    AmigaFuture Autor
  106.